package com.kantboot.business.gc.repository;

import com.kantboot.business.gc.domain.dto.BusGcTypeI18nDTO;
import com.kantboot.business.gc.domain.entity.BusGcTypeI18n;
import io.lettuce.core.dynamic.annotation.Param;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

public interface BusGcTypeI18nRepository extends JpaRepository<BusGcTypeI18n, Long> {

    @Query("""
            FROM BusGcTypeI18n a
            WHERE
            (:#{#param.typeId} IS NULL OR a.typeId = :#{#param.typeId})
            """)
    Page<BusGcTypeI18n> getLanguageListByTypeId(@Param("param") BusGcTypeI18nDTO param, Pageable pageable);
}
